package com.loves.admin.util.exception;

public class BizException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private static final String DEFAULT_CODE = "999";

    /**
     * 错误码
     */
    private final String code;
    /**
     * 错误信息
     */
    private final String message;

    public BizException(String code, String message) {
        super(code);
        this.code = code;
        this.message = message;
    }

    public BizException(String message) {
        super(message);
        this.code = DEFAULT_CODE;
        this.message = message;
    }


    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
